<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN"
            "http://www.w3.org/TR/REC-html40/loose.dtd">
<HTML>
<HEAD>



<META http-equiv="Content-Type" content="text/html; charset=ISO-8859-1">
<META name="GENERATOR" content="hevea 1.08">
<LINK rel="stylesheet" type="text/css" href="umsroot.css">
<TITLE>
Changing the Parser behaviour
</TITLE>
</HEAD>
<BODY >
<A HREF="umsroot143.html"><IMG SRC ="previous_motif.gif" ALT="Previous"></A>
<A HREF="umsroot139.html"><IMG SRC ="contents_motif.gif" ALT="Up"></A>
<A HREF="umsroot145.html"><IMG SRC ="next_motif.gif" ALT="Next"></A>
<HR>

<H2 CLASS="section"><A NAME="htoc314">A.5</A>&nbsp;&nbsp;Changing the Parser behaviour</H2>
<A NAME="@default1204"></A>
Some of these properties can be changed by choosing one of the following
<A HREF="../bips/kernel/env/get_flag-2.html"><B>syntax_options</B></A><A NAME="@default1205"></A>.
The following options exist:
<DL CLASS="description" COMPACT=compact><DT CLASS="dt-description">
<B>bar_is_no_atom</B><DD CLASS="dd-description"> disallow the use of an unquoted vertical bar as
 atom or functor (and turns it into a synonym for a semicolon instead).
<DT CLASS="dt-description"><B>based_bignums</B><DD CLASS="dd-description"> Allow base notation even to write integers longer
 than the wordsize (this implies they are always positive because the
 most significant bit is not interpreted as a sign bit).
<DT CLASS="dt-description"><B>blanks_after_sign</B><DD CLASS="dd-description"> ignore blank space between a sign and a number
 (by default, this space is significant and will lead to the sign
 being taken as prefix operator rather than the number's sign).
<DT CLASS="dt-description"><B>doubled_quote_is_quote</B><DD CLASS="dd-description"> parse a pair of quotes within a quoted item
 as one occurrence of the quote within the string. If this option is off
 (the default), consecutive string-quoted and list-quoted items are parsed
 as a single (concatenated) item, and consecutive quoted atoms are parsed
 as consecutive atoms.
<DT CLASS="dt-description"><B>iso_escapes</B><DD CLASS="dd-description"> ISO-Prolog compatible escape sequences within
 strings and atoms.
<DT CLASS="dt-description"><B>iso_base_prefix</B><DD CLASS="dd-description"> allow binary, octal or hexadecimal numbers to be written
 with 0b, 0o or 0x prefix respectively, and disallow the <CODE>base'number</CODE> notation.
<DT CLASS="dt-description"><B>limit_arg_precedence</B><DD CLASS="dd-description">
 do not allow terms with a precedence higher than 999 as
 structure arguments, unless parenthesised.
<DT CLASS="dt-description"><B>nested_comments</B><DD CLASS="dd-description"> allow bracketed comments to be nested.
<DT CLASS="dt-description"><B>nl_in_quotes</B><DD CLASS="dd-description"> allow newlines to occur inside quotes.
<DT CLASS="dt-description"><B>no_array_subscripts</B><DD CLASS="dd-description"> disallow the ECL<SUP><I>i</I></SUP>PS<SUP><I>e</I></SUP> specific array-subscript
 syntax.
<DT CLASS="dt-description"><B>no_attributes</B><DD CLASS="dd-description"> disallow the ECL<SUP><I>i</I></SUP>PS<SUP><I>e</I></SUP> specific syntax for
 variable attributes in curly braces.
<DT CLASS="dt-description"><B>no_blanks</B><DD CLASS="dd-description"> do not allow blanks between functor an opening parenthesis
<DT CLASS="dt-description"><B>no_curly_arguments</B><DD CLASS="dd-description"> disallow the ECL<SUP><I>i</I></SUP>PS<SUP><I>e</I></SUP> specific syntax for
 structures with named arguments in curly braces.
<DT CLASS="dt-description"><B>read_floats_as_breals</B><DD CLASS="dd-description"> read all floating point numbers as bounded
 reals rather than as floats. The resulting breal is a small interval
 enclosing the true value of the number in decimal notation.
<DT CLASS="dt-description"><B>var_functor_is_apply</B><DD CLASS="dd-description"> allow variables as functors, and parse a term
 like <CODE>X(A,B,C)</CODE> as <CODE>apply(X,[A,B,C])</CODE>.
</DL>
A number of further syntax options is provided for the purpose of parsing
non-Prolog-like languages, in particular the Zinc family:
<DL CLASS="description" COMPACT=compact><DT CLASS="dt-description">
<B>atom_subscripts</B><DD CLASS="dd-description"> allow subscripts after atoms, and parse a term
 like <CODE>a[B,C]</CODE> as <CODE>subscript(a,[B,C])</CODE>.
<DT CLASS="dt-description"><B>general_subscripts</B><DD CLASS="dd-description"> allow subscripts after atoms, parenthesized
 subterms and subscripted terms, and parse a term
 like <CODE>a[B][C]</CODE> as <CODE>subscript(subscript(a,[B]),[C])</CODE>,
 or <CODE>(a-b)[C]</CODE> as <CODE>subscript(a-b,[C])</CODE>.
<DT CLASS="dt-description"><B>curly_args_as_list</B><DD CLASS="dd-description"> parse the arguments of a term in curly
 brackets as a list, i.e. parse <CODE>{a,b,c}</CODE>
 as <CODE>{}([a,b,c])</CODE> instead of the default <CODE>{}((a,b,c))</CODE>.
</DL>
Syntax option settings can be local to a module or exported, e.g.
<PRE CLASS="verbatim">
:- local syntax_option(not nl_in_quotes).
:- export syntax_option(var_functor_is_apply).
</PRE>
<HR>
<A HREF="umsroot143.html"><IMG SRC ="previous_motif.gif" ALT="Previous"></A>
<A HREF="umsroot139.html"><IMG SRC ="contents_motif.gif" ALT="Up"></A>
<A HREF="umsroot145.html"><IMG SRC ="next_motif.gif" ALT="Next"></A>
</BODY>
</HTML>
